package com.aiwiown.thymleaf.wrapper;

import com.aiwiown.thymleaf.filter.XSSHttpServletRequestWrapper;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;


/**
 * XSS Filter
 * <p>Title: RequestWrapperXSSFilter</p>
 * <p>Description: </p>
 *
 * @author dbin0123
 * @version 1.0.0
 * @date 2019/10/25 10:52
 */
public class RequestWrapperXSSFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) { }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        chain.doFilter(new XSSHttpServletRequestWrapper((HttpServletRequest) request), response);
    }

    @Override
    public void destroy() { }
}
